package com.zmn.plat.common.enums;

import java.util.Optional;
import java.util.stream.Stream;

/**
 * 类描述：试点配置枚举
 *
 * @author xujie
 * @since 2021/06/08 17:07
 */
public enum PilotConfigEnum {

    /**
     * 试点配置类型
     */
    PRICE(1, "线上支付"),
    FEE_METER(2, "计价器"),
    THREE_DAY_RETREAT(3, "三日退"),
    PREFERENTIAL_RESTRICTIONS(4, "优惠限制"),
    REPAIR_ROBOT(5, "维修机器人"),
    PAY_ADVANCE(6, "预计价"),
    SERVICE_ACCEPTANCE(7, "服务验收"),
    NEW_FEE_METER(8, "计价器3.0"),
    ;

    /**
     * 类型
     */
    private final Integer type;

    /**
     * 说明
     */
    private final String explain;

    PilotConfigEnum(Integer type, String explain) {

        this.type = type;
        this.explain = explain;
    }

    public Integer getType() {

        return type;
    }

    public String getExplain() {

        return explain;
    }

    public static PilotConfigEnum getPilotConfigEnum(Integer type) {

        Optional<PilotConfigEnum> enumOptional = Stream.of(PilotConfigEnum.values()).filter(s -> s.type.equals(type)).findFirst();
        return enumOptional.orElse(null);
    }
}
